const express = require('express');
const router = express.Router();
const characterController = require('../controllers/characterController');
const authenticate = require('../middleware/auth');

// 创建角色 (需要认证)
router.post('/', authenticate, characterController.createCharacter);

// 获取角色信息
router.get('/:id', characterController.getCharacter);

// 获取用户的所有角色 (需要认证)
router.get('/user/:userId', authenticate, characterController.getUserCharacters);

// 更新角色 (需要认证)
router.put('/:id', authenticate, characterController.updateCharacter);

// 删除角色 (需要认证)
router.delete('/:id', authenticate, characterController.deleteCharacter);

module.exports = router;